package com.wecon.springdemo.pattern.template.order;

import com.wecon.springdemo.mapper.TemplateMapper;

/**
 * @author Weikang  Wang
 * @program: com.wecon.springdemo.pattern.template.order
 * @description:
 * @date 2020/5/11 13:18
 */
public class CompanyB extends AbstractCompany {

    public CompanyB(TemplateMapper templateMapper) {
        super(templateMapper);
    }

    @Override
    String setString(String jsonData) {
        System.out.println("B setString");
        String result = jsonData;

        result = result.replaceAll("[\"]orderNo[\":]", "\"orderId\"");
        result = result.replaceAll("[\"]orderMoney[\":]", "\"orderPrice\"");
        result = result.replaceAll("[\"]merchantId[\":]", "\"productId\"");
        result = result.replaceAll("[\"]merchantCount[\":]", "\"productCount\"");
        result = result.replaceAll("[\"]money[\":]", "\"payPrice\"");
        result = result.replaceAll("[\"]realMoney[\":]", "\"realPayPrice\"");
        result = result.replaceAll("[\"]memberId[\":]", "\"userId\"");
        result = result.replaceAll("[\"]orderTime[\":]", "\"orderDate\"");

        return result;

    }

}
